sizerequest: Use gtk_widget_measure to measure widget sizes
authorTimm Bäder <mail@baedert.org>
Mon, 16 Jan 2017 17:47:31 +0000 (18:47 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 20 Jan 2017 20:33:38 +0000 (21:33 +0100)
gtk/gtksizerequest.c

index 1e16ea870e13fd965b170974c2af1a6bfafd081c..3c58d34d14084d17554e0396b0077539b28f912c 100644 (file)
@@ -143,9 +143,11 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
               gint minimum_height;
               gint natural_height;
 
-             /* Pull the base natural height from the cache as it's needed to adjust
-              * the proposed 'for_size' */
-             gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height);
+              /* Pull the base natural height from the cache as it's needed to adjust
+               * the proposed 'for_size' */
+              gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
+                                  &minimum_height, &natural_height,
+                                  NULL, NULL);
 
               /* convert for_size to unadjusted height (for_size is a proposed allocation) */
               gtk_widget_adjust_size_allocation (widget,
@@ -182,9 +184,11 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
               gint minimum_width;
               gint natural_width;
 
-             /* Pull the base natural width from the cache as it's needed to adjust
-              * the proposed 'for_size' */
-             gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width);
+              /* Pull the base natural width from the cache as it's needed to adjust
+               * the proposed 'for_size' */
+              gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
+                                  &minimum_width, &natural_width,
+                                  NULL, NULL);
 
               /* convert for_size to unadjusted width (for_size is a proposed allocation) */
               gtk_widget_adjust_size_allocation (widget,